<!DOCTYPE html>
<html>
<head>
    <title>项目</title>
    <#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="row">
            <div class="col-xs-2">
                <div class="form-group">
                    <label for="projectName" class="control-label">项目名称</label>
                    <input type="text"  class="form-control" id="projectName" placeholder="项目名称" v-model="q.projectName">
                </div>
            </div>

            <#if shiro.hasPermission("sys:dept:list")>
            <div class="col-xs-2">
                <label for="deptList" class="control-label">所属公司</label>
                <div class="form-group">
                    <select v-model="q.deptId" id="deptList" class="form-control">
                        <option value="">请选择</option>
                        <option v-for="option in deptList"  v-bind:value="option.deptId">
                         {{ option.name }}
                         </option>
                    </select>
                </div>
            </div>
             </#if>

        </div>

        <div class="grid-btn">
            <a class="btn btn-primary" @click="query">查询</a>
            <a class="btn btn-primary" @click="reset">重置</a>

            <#if shiro.hasPermission("data:project:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
            </#if>
           <#if shiro.hasPermission("data:project:update")>
             <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
          </#if>
           <#if shiro.hasPermission("data:project:delete")>
             <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
          </#if>
        </div>

        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default" v-cloak>
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">名称</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="project.name" placeholder="名称"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">所属部门</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" style="cursor:pointer;" v-model="project.deptName" @click="deptTree"  placeholder="所属部门"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<!-- 选择部门 -->
<div id="deptLayer" style="display: none;padding:10px;">
    <ul id="deptTree" class="ztree"></ul>
</div>

<script src="${request.contextPath}/statics/js/modules/data/project.js?_${.now?long}"></script>
</body>
</html>